<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use \Illuminate\Routing\Router;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

use App\Http\Controllers\Api\SmallApp\Register\RegisterController;
use App\Http\Controllers\Api\SmallApp\Login\LoginController;
use App\Http\Controllers\Api\SmallApp\User\UserInfoController;
use App\Http\Controllers\Api\SmallApp\Article\ArticleController;
use App\Http\Controllers\Api\SmallApp\Advert\AdvertController;
use App\Http\Controllers\Api\Web\Sync\SyncUserController;
use App\Http\Controllers\Api\SmallApp\Setting\SettingController;

Route::group(['prefix'=>'sync'],function (Router $router){
    $router->get('/getInfo',[SyncUserController::class,'getInfo']);
});
Route::group(['prefix'=>'setting'],function (Router $router){
    $router->get('/lst',[SettingController::class,'lst']);
});
Route::group(['prefix'=>'advert'],function (Router $router){
    $router->get('/lst',[AdvertController::class,'lst']);
});

Route::group(['prefix'=>'register'],function (Router $router){

    $router->post('/accountLogin',[LoginController::class,'accountLogin']);
    $router->post('/phoneLogin',[LoginController::class,'phoneLogin']);
    $router->post('/forgetPassword',[LoginController::class,'forgetPassword']);
    $router->post('/add',[RegisterController::class,'add']);
    $router->get('/getVerifyCode',[RegisterController::class,'getVerifyCode']);
    $router->get('/article/lst',[ArticleController::class,'lst']);

});

Route::group(['prefix'=>'my','middleware'=>'checkapi'],function (Router $router){

    $router->get('/userInfo',[UserInfoController::class,'userInfo']);
    $router->get('/getWxInfo',[UserInfoController::class,'getWxInfo']);
    $router->get('/checkSerialNumber',[UserInfoController::class,'checkSerialNumber']);
    $router->post('/changePhone',[UserInfoController::class,'changePhone']);
    $router->post('/changePassword',[UserInfoController::class,'changePassword']);
    $router->post('/getDriverInfo',[UserInfoController::class,'getDriverInfo']);
    $router->post('/updateUserInfo',[UserInfoController::class,'updateUserInfo']);
    $router->get('/active',[UserInfoController::class,'active']);

});
